﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.Master" AutoEventWireup="true" CodeBehind="BGM_Strategy_Type.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Strategy_Type" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<%@ Register src="../Controls/Panel/UserPanel.ascx" tagname="UserPanel" tagprefix="uc3" %>
<%@ Register src="../Controls/Panel/CommandPanel.ascx" tagname="CommandPanel" tagprefix="uc4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<Link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css">

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None"  > 
</telerik:RadAjaxLoadingPanel>

<telerik:RadAjaxManager runat="server" ID="RadManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="CmdCtrl">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelGrid" LoadingPanelID="RadAjaxLoadingPanel1"/>
                    <telerik:AjaxUpdatedControl ControlID="PanelList" LoadingPanelID="RadAjaxLoadingPanel1"/>                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Grid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelGrid" LoadingPanelID="RadAjaxLoadingPanel1"/>
                    <telerik:AjaxUpdatedControl ControlID="PanelList" LoadingPanelID="RadAjaxLoadingPanel1"/>
                    <telerik:AjaxUpdatedControl ControlID="CmdCtrl" LoadingPanelID="RadAjaxLoadingPanel1"/>                                               
                </UpdatedControls>
            </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<asp:Label ID="hdSeq" runat="server" ></asp:Label>

<table style="width: 980px; height: 100%;">
    <tr>
    <%--<td width="274px" valign="top">
        <uc3:UserPanel ID="UserCtrl" runat="server" />
    </td>--%>
    <td valign="top">
        <uc4:CommandPanel ID="CmdCtrl" runat="server" />
    </td>

    </tr>
    <tr>
    <td valign = "top" colspan="2">
        <div class="Background980">
        <div class="BackgroundBottom980">
                <asp:Panel ID="panelHeader" runat="server">
                    <div class="header-grid">
                        <asp:Label ID="lblHeader" runat="server" Text="ประเภทยุทธศาสตร์"></asp:Label>
                    </div>
                </asp:Panel>
                <asp:Panel ID="panelList" runat="server" Height="360px" ScrollBars="Auto" Visible="false">
                    <ul id="SourceTypeInfo" class="formList">
                        <li><table><tr><td width="150px">รหัส :</td><td><asp:Label ID="lbCode" runat="server" AssociatedControlID="txtCode"></asp:Label>
                            <asp:TextBox ID="txtCode" runat="server" Visible="false" Width="150px" 
                                ValidationGroup="1"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="txtCode" ErrorMessage="*" SetFocusOnError="True" 
                                ValidationGroup="1"></asp:RequiredFieldValidator>
                            </td></tr></table>
                        </li>
                        <li><table><tr><td width="150px">ชื่อประเภทยุทธศาสตร์ :</td><td><asp:Label ID="lbName" runat="server" AssociatedControlID="txtName"></asp:Label>
                            <asp:TextBox ID="txtName" runat="server" Text="" Visible="false" Width="300px" 
                                ValidationGroup="1"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="txtName" ErrorMessage="*" SetFocusOnError="True" 
                                ValidationGroup="1"></asp:RequiredFieldValidator>
                            </td></tr></table>
                        </li>
                        <li><table><tr><td valign="top" width="150px">คำอธิบาย :</td><td><asp:Label ID="lbDescr" runat="server" AssociatedControlID="txtDescr"></asp:Label>
                            <asp:TextBox ID="txtDescr" runat="server" Height="100"  Text="" TextMode="MultiLine" Visible="false" Width="300px"></asp:TextBox></td></tr></table>
                        </li>
                        <li class="lastListItem">
                        </li>
                    </ul>
                </asp:Panel>
                <asp:Panel ID="panelGrid" runat="server" Height="360px" ScrollBars="Auto" Visible="true">
                    <br />
                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="Grid" runat="server" AllowFilteringByColumn="true" 
                        AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True" 
                        AutoGenerateColumns="False" EnableAJAX="True" OnItemCommand="Grid_ItemCommand"
                        GridLines="None" PageSize="8" ShowStatusBar="false">
                        <MasterTableView AllowMultiColumnSorting="true" DataKeyNames="Sequence" ClientDataKeyNames="Sequence"
                            Width="100%">
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            <Columns>
                                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" ItemStyle-Width="30px"
                                 HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                 </telerik:GridClientSelectColumn>
                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Code" 
                                    FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                    HeaderText="รหัส" ItemStyle-Width="100px" ShowFilterIcon="false" ItemStyle-HorizontalAlign="Center"
                                    UniqueName="Code">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Name" FilterControlWidth="100%" 
                                    HeaderStyle-HorizontalAlign="Center" Visible="false"
                                    ShowFilterIcon="false">
                                    <ItemTemplate>
                                        <asp:Label ID="targetSequence" runat="server" Text='<%# Eval("Sequence") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>                                
                                <telerik:GridTemplateColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Name" FilterControlWidth="100%" 
                                    HeaderStyle-HorizontalAlign="Center" HeaderText="ชื่อประเภทยุทธศาสตร์" 
                                    ShowFilterIcon="false" ItemStyle-Width="200px" UniqueName="Name">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="targetControl" runat="server" CommandName="TargetClick"
                                            Text='<%# Eval("Name") %>'></asp:LinkButton>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>                                
                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Description" 
                                    FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                    HeaderText="คำอธิบาย" ShowFilterIcon="false" UniqueName="Description">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true" >
                            <Selecting AllowRowSelect="True" />
                            <ClientEvents  />
                        </ClientSettings>
                    </telerik:RadGrid>
                </asp:Panel>
           </div>
        </div>
    </td>
    </tr>
    </table>    

</asp:Content>
